<template>
	<view class="bg-light" style="min-height: 650px;">
		<tabsTop tabName="钱包"></tabsTop>
		<!-- 我的零钱 -->
		<view>
			<view class="my bg-white flex justify-between p-2 align-center mb-2" @click="goMyPocket(money)">
				<view class="flex">
					<image :src="Domain_ICON+'/pocketMoney.png'"></image>
					<view class="ml-2">我的零钱</view>
				</view>
				<view class="flex">
					<view>￥{{ formatMoney(money)}}</view>
					<uni-icons type="right" color="#828d96" size="16" class="flex align-center ml-2"></uni-icons>
				</view>
			</view>
			<!-- 银行卡 -->
			<view class="my bg-white flex justify-between p-2 align-center mb-2" @click="goBankCards">
				<view class="flex">
					<image :src="Domain_ICON+'/bankCards.png'"></image>
					<view class="ml-2">银行卡</view>
				</view>
				<view>
					<uni-icons type="right" color="#828d96" size="16" class="flex align-center"></uni-icons>
				</view>
			</view>
			<!-- 账单 -->
			<view class="my bg-white flex justify-between p-2 align-center mb-2" @click="goBill">
				<view class="flex">
					<image :src="Domain_ICON+'/bill.png'"></image>
					<view class="ml-2">账单</view>
				</view>
				<view>
					<uni-icons type="right" color="#828d96" size="16" class="flex align-center"></uni-icons>
				</view>
			</view>
			<!-- 安全保障 -->
			<view class="my bg-white flex justify-between p-2 align-center mb-2">
				<view class="flex">
					<image :src="Domain_ICON+'/safe.png'"></image>
					<view class="ml-2">安全保障</view>
				</view>
				<view>
					<uni-icons type="right" color="#828d96" size="16" class="flex align-center"></uni-icons>
				</view>
			</view>
		</view>
		<view class="issue text-center">联系客服</view>
	</view>
</template>

<script>
	const app = getApp();
	import tabsTop from "@/components/tabs/tabs-top.vue";
	export default {
		components: { //轮播图组件
			tabsTop,
		},
		data() {
			return {
				Domain_ICON: app.globalData.Domain_ICON,
				money: 20,
			}
		},
		onLoad() {

		},
		methods: {
			formatMoney(amount) {
				return amount.toLocaleString(undefined, {
					minimumFractionDigits: 2,
					maximumFractionDigits: 2
				});
			},
			goMyPocket(money) {
				uni.navigateTo({
					url: `/pages/my/myPocket?money=${encodeURIComponent(money)}`
				});
			},
			goBankCards() {
				uni.navigateTo({
					url: `/pages/my/bankCards`
				});
			},
			goBill() {
				uni.navigateTo({
					url: `/pages/my/bill`
				});
			}
		}
	}
</script>

<style>
	image {
		width: 20px;
		height: 20px;
	}

	.my {
		height: 30px;
	}
	.issue {
		color: #869ab3;
		font-size: 10px;
		position: absolute;
		bottom: 40px;
		left: 46%;
	}
</style>